namespace SubhadraSolutions.Sharp.Logging.LogSubscribers.EventLog
{
    using SubhadraSolutions.Sharp.Utils.Reflection;
    using System;
    using System.Diagnostics;

    [Serializable]
    public class EventLogItem
    {
        #region Constructors

        public EventLogItem()
        {
        }

        public EventLogItem(string message, EventLogEntryType eventSeverity, int eventID,
            short category,
            byte[] rawData)
        {
            Message = message;
            EventSeverity = eventSeverity;
            EventID = eventID;
            Category = category;
            RawData = rawData;
        }

        #endregion Constructors

        #region Properties

        [PropertyOrder(2)]
        public short Category
        {
            get;
            set;
        }

        [PropertyOrder(1)]
        public int EventID
        {
            get;
            set;
        }

        [PropertyOrder(0)]
        public EventLogEntryType EventSeverity
        {
            get;
            set;
        }

        [PropertyOrder(4)]
        public string Message
        {
            get;
            set;
        }

        [PropertyOrder(5)]
        public byte[] RawData
        {
            get;
            set;
        }

        #endregion Properties

        #region Methods

        public override string ToString()
        {
            return DynamicToStringHelper<EventLogItem>.ExportAsString(this);
        }

        #endregion Methods
    }
}